@import './descriptionsType.theme.less';
@desc-background-color: #fff;
@desc-label-background-color: #fafafa;
@desc-border-color: #f0f0f0;
@desc-label-tip-color: red;

@scroll-horizontal-width: 1px;
@scroll-vertical-height: 5px;
@scroll-background: rgba(0, 0, 0, 0.2);
@scroll-background-hover: rgba(0, 0, 0, 0.3);

.descriptionsType-rootBoxDiv {
  :global {
    .ant-divider {
      font-weight: 600;
    }

    .list-table {
      height: auto !important;

      .ant-table > .ant-table-container > .ant-table-body::-webkit-scrollbar-thumb {
        border-bottom: 1px solid @desc-border-color;
        border-right: 1px solid @desc-border-color;
        border-left: 1px solid @desc-border-color;
      }
    }

    .ant-divider-horizontal.ant-divider-with-text {
      margin: 8px 0px;
    }

    // .ant-divider-horizontal.ant-divider-with-text:not(:first-child) {
    //   padding-top: 16px;
    // }

    .ant-space {
      margin-bottom: 8px;
      width: 100%;
    }

    .ant-empty {
      padding: 32px 0px;
      background-color: @desc-label-background-color;
      margin: 0px;
    }
  }

  // 表格样式
  .descriptionsType-tableSty {
    .ant-table {
      border-radius: 0px;
      padding: 0px;
      margin: 0px !important;
    }
  }

  // 表格表单样式
  .descriptionsType-tableFormSty {
    .ant-form-item {
      margin-bottom: 0px;

      .ant-input-textarea-show-count::after {
        margin-bottom: -22px !important;
        // z-index: 99;
        z-index: 1;
        position: relative;
        top: -24px;
        right: 8px;
      }

      input,
      textarea,
      .ant-input-affix-wrapper,
      .ant-select-selector,
      .ant-picker,
      .ant-input-number {
        border: none;
      }

      .ant-input-number {
        width: 100%;
      }

      .ant-input[disabled],
      .ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector,
      .ant-input-affix-wrapper-disabled,
      .ant-radio-button-disabled,
      .ant-radio-button-wrapper-disabled,
      .ant-picker-disabled,
      .ant-input-number-disabled,
      .ant-checkbox-disabled + span {
        color: rgba(0, 0, 0, 0.85);
        background-color: @desc-background-color;
      }

      .ant-picker-input > input {
        color: #000;
      }

      .ant-input::-webkit-scrollbar {
        width: @scroll-horizontal-width;
        height: @scroll-vertical-height;
      }

      .ant-input::-webkit-scrollbar-thumb {
        -webkit-transition: all 0.25s;
        background: @scroll-background;
        transition: all 0.25s;
        border-radius: 0px;
      }

      .ant-input::-webkit-scrollbar-thumb:hover {
        background: @scroll-background-hover;
      }
    }
  }

  .ant-table-body::-webkit-scrollbar {
    border-bottom: 1px solid @desc-border-color;
    border-right: 1px solid @desc-border-color;
    border-left: 1px solid @desc-border-color;
  }

  .descriptionsType-rootBoxDiv-formTableTitle {
    text-align: center;
    padding: 8px 16px;
    font-weight: 600;
    border-right: 1px solid @desc-border-color;
    border-left: 1px solid @desc-border-color;
    border-top: 1px solid @desc-border-color;
  }

  .descriptionsType-rootBoxDiv-formTableTitleTypography {
    padding: 10px 0px 0px;
    font-weight: 600;
  }

  // .descriptionsType-rootBoxDiv-formTableTitle:first-child {
  //   border-top: 1px solid @desc-border-color;
  // }
}

.descriptionsType-container-header {
  overflow: hidden;
  width: 100%;

  .ant-form-item {
    margin: 0;
    background-color: @desc-background-color;

    .ant-input {
      min-height: 48px;
      text-align: center;
      border: none !important;
      outline: none !important;
      box-shadow: none !important;
      border-radius: 0px;
      font-weight: 600;
    }

    .ant-input[disabled] {
      color: rgba(0, 0, 0, 0.85);
      background-color: @desc-background-color;
    }
  }
}

.descriptionsType-container {
  border: 1px solid @desc-border-color;
  border-left: 0px;
  background-color: @desc-background-color;
  overflow: hidden;
  margin-bottom: 0px;

  .descriptionsType-item-row {
    overflow: hidden;
    height: 100%;
    display: flex;
  }

  .descriptionsType-item {
    width: 50%;
    min-height: 48px;
    float: left;
    display: flex;

    .descriptionsType-item-label {
      background-color: @desc-label-background-color;
      width: 180px;
      min-width: 180px;
      padding: 8px 16px;
      display: flex;
      align-items: center;
      border-right: 1px solid @desc-border-color;
      border-left: 1px solid @desc-border-color;
      border-bottom: 1px solid @desc-border-color;

      .required {
        position: relative;
      }

      .required::before {
        content: '*';
        color: @desc-label-tip-color;
        position: absolute;
        font-size: 18px;
        left: -10px;
      }
    }

    .descriptionsType-item-content {
      width: calc(100% - 180px);
      display: flex;
      align-items: center;
      overflow: hidden;
      border-bottom: 1px solid @desc-border-color;

      .descriptionsType-item-content-anticon-left {
        // min-width: 38px;
        // max-width: 100px;
        white-space: nowrap;
        padding: 0px 12px;
        height: 100%;
        color: rgba(0, 0, 0, 0.85);
        display: flex;
        align-items: center;
        justify-content: center;
        border-right: 1px solid @desc-border-color;
        background-color: @desc-label-background-color;
        cursor: pointer;
      }

      .descriptionsType-item-content-anticon {
        // min-width: 38px;
        // max-width: 100px;
        white-space: nowrap;
        padding: 0px 12px;
        height: 100%;
        color: rgba(0, 0, 0, 0.85);
        display: flex;
        align-items: center;
        justify-content: center;
        border-left: 1px solid @desc-border-color;
        background-color: @desc-label-background-color;
        cursor: pointer;
      }

      .renderFileBox {
        padding: 0px 8px 4px;
      }

      .ant-form-item {
        margin: 0;
        width: 100%;
        height: 100%;
        display: flex;
        padding-left: 8px;
        align-items: center;

        .ant-upload {
          padding-top: 4px;
        }

        .ant-form-item-row,
        .ant-form-item-control-input,
        .ant-form-item-control-input-content,
        .ant-input-group-wrapper,
        .ant-input-group {
          width: 100%;
          height: 100%;
        }

        .ant-select-multiple .ant-select-selection-placeholder {
          left: 0px;
        }

        .ant-select-multiple .ant-select-selection-overflow-item .ant-select-selection-search {
          width: 0px;
          margin: 0px;
        }

        .ant-input::-webkit-scrollbar {
          width: @scroll-horizontal-width;
          height: @scroll-vertical-height;
        }

        .ant-input::-webkit-scrollbar-thumb {
          -webkit-transition: all 0.25s;
          background: @scroll-background;
          transition: all 0.25s;
          border-radius: 0px;
        }

        .ant-input::-webkit-scrollbar-thumb:hover {
          background: @scroll-background-hover;
        }
      }

      .ant-form-item-control-input-content {
        display: flex;
        align-items: center;
      }

      .ant-select-selection-search {
        left: 0px;
      }

      input,
      .ant-select,
      .ant-picker,
      .ant-picker:focus,
      .ant-select-selector,
      .ant-input,
      .ant-input-number,
      .ant-input-number-input-wrap,
      .ant-input-number-input,
      .ant-input:focus,
      .ant-input-textarea,
      .ant-select-selection-search-input,
      .ant-select-selection-search-input:focus,
      .ant-input-affix-wrapper,
      .ant-input-affix-wrapper:focus,
      .ant-select-selector:focus {
        width: 100%;
        height: 100%;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        color: #000;
      }
    }

    .ant-input-number-status-error {
      .ant-input-number-handler-wrap {
        height: calc(100% + 27px);
      }
    }

    .ant-select-selector {
      display: flex;
      align-items: center;
    }

    .ant-input-textarea {
      padding: 8px 8px 8px 0;
    }

    .ant-picker-suffix,
    .ant-input-suffix,
    .ant-picker-clear {
      width: 36px;
      margin: 0;
      color: rgba(0, 0, 0, 0.25);
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .ant-input[disabled],
    .ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector,
    .ant-input-affix-wrapper-disabled,
    .ant-radio-button-disabled,
    .ant-radio-button-wrapper-disabled,
    .ant-picker-disabled,
    .ant-input-number-disabled,
    .ant-checkbox-disabled + span {
      color: rgba(0, 0, 0, 0.85);
      background-color: @desc-background-color;
    }

    .ant-input-textarea-show-count.ant-input-textarea-in-form-item::after {
      z-index: 99;
      position: relative;
      top: -25px;
      right: 8px;
    }
  }

  .descriptionsType-item-col-span-0 {
    display: none;
  }

  .descriptionsType-item-col-span-1 {
    width: 50%;
  }

  .descriptionsType-item-col-span-2 {
    width: 100%;
  }

  .descriptionsType-item-row:last-child {
    .descriptionsType-item-label,
    .descriptionsType-item-content {
      border-bottom: none;
    }
  }
}
